package com.wondertek.poms.dao.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Proxy;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@Data
@Entity
@Table(name = "PRODUCT_GROP_MEMBER")
@DynamicUpdate
@DynamicInsert
@Proxy(lazy = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ProductGropMember implements Serializable {

    private static final long serialVersionUID = -6630972500521871186L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "PRODUCT_GROP_MEMBER_SEQ")
    @SequenceGenerator(name = "PRODUCT_GROP_MEMBER_SEQ", allocationSize = 1, sequenceName = "PRODUCT_GROP_MEMBER_SEQ")
    private Long id;

    @Column(name = "GROUP_ID")
    private Long groupId;

    @Column(name = "PRODUCT_ID")
    private String productId;

    /**
     *   创建时间
     */
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name="CREATE_TIME")
    private Date createTime;

    /**
     *   0:启用 1:禁用
     */
    @Column(name = "STATUS")
    private String status;
}
